package com.nc.delivery_project.shared.servicelocator;

import com.google.web.bindery.requestfactory.shared.ServiceLocator;
import com.nc.delivery_project.server.service.LegalPersonService;

/**
 * Created by miroshnik on 1/28/2015.
 */
public class LegalPersonServiceLocator implements ServiceLocator {
    
    private static LegalPersonService serviceInstance;

    @Override
    public Object getInstance(Class<?> clazz) {
        return LegalPersonServiceLocator.getServiceInstance();
    }

    private static LegalPersonService getServiceInstance() {
        if (serviceInstance == null) {
            serviceInstance = new LegalPersonService();
        }

        return serviceInstance;
    }
}
